//
//  GWItemModel.m
//  GiftWanted
//
//  Created by lanou on 15/11/9.
//  Copyright © 2015年 陈文杰. All rights reserved.
//

#import "GWItemModel.h"

@implementation GWItemModel
- (instancetype)init {
    if (self=[super init]) {
        _image_urls = [NSMutableArray arrayWithCapacity:0];
    }
    return self;
}

- (void)setValue:(id)value forKey:(NSString *)key {
    
    if ([key isEqualToString:@"image_urls"]) {
        for (NSString *str in value) {
            [_image_urls addObject:str];
        }
    } else {
        [super setValue:value forKey:key];
    }
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
    if ([key isEqualToString:@"description"]) {
        _description_s = value;
    } else if ([key isEqualToString:@"source"]) {
        _button_title = value[@"button_title"];
    } 
}


@end
